package com.hl.wuyeguanliIDEA.web;

import com.hl.wuyeguanliIDEA.pojo.ComplaintRegistration;
import com.hl.wuyeguanliIDEA.service.ComplaintRegistrationService;
import com.hl.wuyeguanliIDEA.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/complaint")
public class ComplaintRegistrationController {

    @Autowired
    private ComplaintRegistrationService complaintRegistrationService;
    @RequestMapping("/insertAll")
    public R insertAll(ComplaintRegistration c1) {
        int num=complaintRegistrationService.insertAll(c1);
        if (num>0){
            return R.success(c1);
        }else {
            return R.fail();
        }

    }
    @RequestMapping("/selectAll")
    public List<ComplaintRegistration> selectAll(ComplaintRegistration c1) {
        return complaintRegistrationService.selectAll(c1);
    }

    @RequestMapping("/selectPart")
    public List<ComplaintRegistration> selectPart(ComplaintRegistration c1) {
        return complaintRegistrationService.selectPart(c1);
    }

    @RequestMapping("/updateType")
    public int updateType(ComplaintRegistration c1) {
        return complaintRegistrationService.updateType(c1);
    }


}
